//
//  HCVIPViewController.m
//  HappyChildren
//
//  Created by WillyZhao on 2017/1/21.
//  Copyright © 2017年 WillyZhao. All rights reserved.
//

#import "HCVIPViewController.h"

#import "HCVIPView.h"

#import "HCVipModel.h"

@interface HCVIPViewController () {
    HCVipModel *vipModel;
    HCVIPView *vipView;
}

@end

@implementation HCVIPViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.textTitle = @"会员卡";
    
    self.dataRequest.delegate = self;
    vipView = [[HCVIPView alloc] initWithFrame:CGRectMake(0, 0, self.centerView.frame.size.width, self.centerView.frame.size.height)];
    [self.centerView addSubview:vipView];
    
    [self.dataRequest postHC_VIPCard:HCGETUSER(@"userid")];
    
    // Do any additional setup after loading the view.
}

-(void)dataRequesterFinish:(DataRequester *)requester requesterWithType:(DataRequestType)aType receiveDictionary:(NSDictionary *)dictionary {
    vipModel = [[HCVipModel alloc] initWithDictionary:dictionary error:nil];
    vipView.model = vipModel;
    NSLog(@"会员卡详情:%@",dictionary[@"type"]);
}

-(void)dataRequesterFail:(DataRequester *)requester requesterWithType:(DataRequestType)aType receiveErrorDictionary:(NSDictionary *)dictionary {
    NSLog(@"会员卡详情失败");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
